<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	Function.prototype.myApply = function(content,arg=[]){
		if(content === undefined || content === null){
			content = window;
		}else if(typeof content !== "object" && typeof content !== "function"){
			content = new Object(content);;
		}
		// 生成一个属性名，值为随机的字符串
		const key = Math.random().toString(36).slice(2);
		// 为content对象增加属性：属性名字为key的值，属性值为this(fn)
		content[key] = this;
		content[key](...arg);
		delete content[key];
	}
	function fn(a,b,c){
		console.log(this,a,b,c);
	}
	fn.myApply({},[1,2,3]);
</script>
</html>